//
//  ViewController.m
//  gitExecise
//
//  Created by songhuipan on 16/6/9.
//  Copyright © 2016年 songhuipan. All rights reserved.
//

#import "ViewController.h"

@interface ViewController ()<UITableViewDataSource,UITableViewDelegate>
@property (nonatomic,strong)UITableView *tableView;
@end

@implementation ViewController

- (void)viewDidLoad {
    [super viewDidLoad];

    //创建一个Button
    UIButton *hlButton = [[UIButton alloc]initWithFrame:CGRectMake(100, 100, 100, 200)];
    hlButton.backgroundColor = [UIColor redColor];
    [hlButton addTarget:self action:@selector(buttonClick:) forControlEvents:UIControlEventTouchUpInside];
    [self.view addSubview:hlButton];
    
    [self.view addSubview:({
        self.tableView = [[UITableView alloc]initWithFrame:self.view.bounds style:UITableViewStylePlain];
        self.tableView.delegate = self;
        self.tableView.dataSource = self;
        self.tableView.backgroundColor = [UIColor redColor];
        
        _tableView;
        
    })];

 
}
- (void)buttonClick:(UIButton *)sender{

    NSLog(@"按钮被点击了");


    }
- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section {
    return 10;
}
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
    return nil;
}
@end
